<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>飞翔的小鸟Rust版本</title>
  <style>
    canvas {
      border: 1px solid #000;
    }
  </style>
</head>

<body>
  <canvas width="375" height="667" id="canvas">当前浏览器不支持canvas元素</canvas>
  <script type="module">
    import init, { Game } from './pkg/flappybird_CanvasByRustWasm.js';
    ((async function main() {
      await init();
      const game = new Game('canvas');
      game.game_start();
      function animation() {
        game.animation()
        requestAnimationFrame(animation);
      }
      animation()
    })())
  </script>
</body>

</html>